package com.yuetong.quotation.service.impl;

import java.util.List;
import java.util.Map;

import com.yuetong.common.utils.DateUtils;
import com.yuetong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yuetong.quotation.mapper.YtQuotationSummaryMapper;
import com.yuetong.quotation.domain.YtQuotationSummary;
import com.yuetong.quotation.service.IYtQuotationSummaryService;

/**
 * 报价汇总Service业务层处理
 *
 * @author  卓晓君
 * @date 2025-02-11
 */
@Service
public class YtQuotationSummaryServiceImpl implements IYtQuotationSummaryService
{
    @Autowired
    private YtQuotationSummaryMapper ytQuotationSummaryMapper;

    /**
     * 查询报价汇总
     *
     * @param summaryId 报价汇总主键
     * @return 报价汇总
     */
    @Override
    public YtQuotationSummary selectYtQuotationSummaryBySummaryId(Long summaryId)
    {
        return ytQuotationSummaryMapper.selectYtQuotationSummaryBySummaryId(summaryId);
    }

    /**
     * 查询报价汇总列表
     *
     * @param ytQuotationSummary 报价汇总
     * @return 报价汇总
     */
    @Override
    public List<YtQuotationSummary> selectYtQuotationSummaryList(YtQuotationSummary ytQuotationSummary)
    {
        return ytQuotationSummaryMapper.selectYtQuotationSummaryList(ytQuotationSummary);
    }

    /**
     * 新增报价汇总
     *
     * @param ytQuotationSummary 报价汇总
     * @return 结果
     */
    @Override
    public int insertYtQuotationSummary(YtQuotationSummary ytQuotationSummary)
    {
        ytQuotationSummary.setCreateTime(DateUtils.getNowDate());
        return ytQuotationSummaryMapper.insertYtQuotationSummary(ytQuotationSummary);
    }

    /**
     * 修改报价汇总
     *
     * @param ytQuotationSummary 报价汇总
     * @return 结果
     */
    @Override
    public int updateYtQuotationSummary(YtQuotationSummary ytQuotationSummary)
    {
        ytQuotationSummary.setUpdateTime(DateUtils.getNowDate());
        return ytQuotationSummaryMapper.updateYtQuotationSummary(ytQuotationSummary);
    }

    /**
     * 批量删除报价汇总
     *
     * @param summaryIds 需要删除的报价汇总主键
     * @return 结果
     */
    @Override
    public int deleteYtQuotationSummaryBySummaryIds(Long[] summaryIds)
    {
        return ytQuotationSummaryMapper.deleteYtQuotationSummaryBySummaryIds(summaryIds);
    }

    /**
     * 删除报价汇总信息
     *
     * @param summaryId 报价汇总主键
     * @return 结果
     */
    @Override
    public int deleteYtQuotationSummaryBySummaryId(Long summaryId)
    {
        return ytQuotationSummaryMapper.deleteYtQuotationSummaryBySummaryId(summaryId);
    }
//报价金额折线图
    @Override
    public List<Map> selectLineQuotation() {
        return ytQuotationSummaryMapper.selectLineQuotation() ;
    }
}
